// JavaScript Document
function changeclass(classid, classname) {
    if (classid == '1' || classid == '2' || classid == '3' || classid == '1,2,3') {
        document.getElementById("classid").value = classid;
        document.getElementById("defaultselect").innerHTML = classname;
        document.getElementById("selectlist").style.display = 'none';
        var tli = document.getElementById("selectlist").getElementsByTagName("li");
        for (i = 0; i < tli.length; i++) {
            tli[i].className = '';
        }
        switch (classid) {
            case '1': document.getElementById("sel_li_1").className = 'foucs'; break
            case '2': document.getElementById("sel_li_2").className = 'foucs'; break
            case '3': document.getElementById("sel_li_3").className = 'foucs'; break
            case '1,2,3': document.getElementById("sel_li_0").className = 'foucs'; break
        };
    }
}
function showSelect(hld, id) {
    var ele = document.getElementById(id);
    ele.style.display = 'block';
    var timer = null;
    ele.onmouseover = function() {
        if (timer) {
            clearTimeout(timer);
        }
        ele.style.display = 'block';
    }
    ele.onmouseout = function() {
        timer = setTimeout(function() { ele.style.display = 'none' }, 200);
    }

    hld.onmouseover = function() {
        if (timer) {
            clearTimeout(timer);
        }
    }
    hld.onmouseout = function() {
        timer = setTimeout(function() { ele.style.display = 'none' }, 200);
    }
}

function setfoucs(obj) {
    var tli = document.getElementById("selectlist").getElementsByTagName("li");
    for (i = 0; i < tli.length; i++) {
        tli[i].className = "";
    }
    obj.className = "foucs";
}

function setTab(m, n, o) {
    var tli = document.getElementById("navOpt" + m).getElementsByTagName("li");
    for (i = 0; i < tli.length; i++) {
        var mdiv = document.getElementById("nav" + o + i);
        tli[i].className = i == n ? "foucs" : "";
        mdiv.style.display = i == n ? "block" : "none";
    }
}
function ShowImg(tab, lino) {
    $("li[id^='li_" + tab + "_']", $('.rankList')).each(function() {
        $(this).removeClass('rankFirst');
        $(".rankFirstImg", $(this)).hide();
    });
    $("#li_" + tab + "_" + lino + "").addClass('rankFirst');
    $(".rankFirstImg", $("#li_" + tab + "_" + lino + "")).show();
}
function search_sub(){
	var keyword = document.getElementById("keyword").value;
	if(keyword.length<=2){alert("请输入至少2个关键字");return;}else{return true;}
}